<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <p>鼠标修饰符</p>
    <div @click.left="show('left')">left</div>
    <div @click.middle="show('mid')">mid</div>
    <div @click.right="show('right')">right</div>
    <p>表单修饰符,也叫v-model的修饰符：trim、number、lazy</p>
    <p>number：只能输入数字。用于金额、数量的输入框</p>
    <input type="text" v-model.number="val1">
    <p>{{val1}}</p>
    <hr>
    <p>trim：过滤首尾空格.用于账号密码</p>
    <input type="text" v-model.trim="val2">
    <p>{{val2}}</p>
    <hr>
    <p>lazy：input事件换乘了change事件，延迟响应。防抖节流</p>
    <input type="text" v-model.lazy="val3">
    <p>{{val3}}</p>
  </div>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: "#app",
      data: {
        val1: '',
        val2: '',
        val3: '',
      },
      methods: {
        show(arg) {
          console.log(arg);
        }
      },
    })
  </script>
</body>
</html>